<#-- 页面头部的引用 -->
<#macro headContent>
	<!DOCTYPE html>
	<html>
	<head>
	    <meta charset="UTF-8">
	    <title>${(systemConfig.headMainTitle)!'后台信息管理系统'}</title>
	    <link rel="stylesheet" href="${baseStatic}/easyui/themes/gray/easyui.css?v=1.1">
	    <link rel="stylesheet" href="${baseStatic}/easyui/themes/icon.css?v=2.2">
	    <#--<link rel="stylesheet" href="${baseStatic}/bootstrap/css/bootstrap.min.css?v=1.1">-->
	    <link rel="stylesheet" href="${baseStatic}/css/body.css?v=0.8">
	    
	    <script src="${baseStatic}/easyui/jquery.min.js"></script>
		<script src="${baseStatic}/easyui/jquery.easyui.min.js"></script>
		<script src="${baseStatic}/easyui/locale/easyui-lang-zh_CN.js"></script>
		<script src="${baseStatic}/js/template-web.js?v=1.0"></script>
		<script src="${baseStatic}/js/message.js?v=1.1"></script>
		<script src="${baseStatic}/js/formatter.js?v=1.9.1"></script>
		<script src="${baseStatic}/js/index.js?v=4.7"></script>
		<#--<script src="${baseStatic}/bootstrap/js/bootstrap.min.js"></script>-->
	</head>
	 <script type="text/javascript">
	 	var ctx="${base}";
	 	var staticctx="${baseStatic}";
	 </script>
</#macro>

<#macro headMainContent>
	<!doctype html>
	<html>
	<head>
	<meta charset="utf-8">
	<link rel="stylesheet" href="${baseStatic}/css/base.css?v=1.1">
	<link rel="stylesheet" href="${baseStatic}/css/home.css?v=1.1">
	
	<script src="${baseStatic}/easyui/jquery.min.js"></script>
	<script src="${baseStatic}/js/main.js?v=1.2"></script>
	</head>
</#macro>

<#--引用-->
<#macro script type href version="1.0">
	<#if type=="css"><link rel="stylesheet" href="${baseStatic}/${href}?v=${version}"/></#if>
	<#if type=="js"><script src="${baseStatic}/${href}?v=${version}"></script></#if>
</#macro>

<#-- 开关控件 -->
<#macro switchInput name lable="" labelwidth="60" width="120" tag=""   value="" onText="开" offText="关">
	<div>
		<input class="easyui-switchbutton" type="text" id="${name}_id" name="${name}" 
		 data-options="value:'${value}',onText:'${onText}',offText:'${offText}',handleText:'${lable}',width:${width},handleWidth:${labelwidth}"/>
		<#if tag!=""><um>${tag}</um></#if>
	</div>
</#macro>

<#--输入框-->
<#macro labInput name lable="" prompt=""  tag="" disable="" comstyle="width:261px;height:31px;" value="" cls="easyui-textbox">
	<div>
		<input class="${cls}" type="text"  style="${comstyle}"  id="${name}_id" name="${name}" 
		 data-options="<#if lable!=''>buttonText:'${lable}:',buttonAlign:'left',</#if>prompt:'${prompt}',cls:'form-input', <#if tag!=''>icons:[{iconCls:'icon-must'}],</#if><#if disable!=''>disabled:true,readonly:true,</#if>value:'${value}'"/>
	</div>
</#macro>

<#--文本输入框，多行-->
<#macro labInputmulti name lable="" prompt=""  tag="" comstyle="width:261px;height:100px;" value="">
	<div>
		<input class="easyui-textbox" type="text"  style="${comstyle}"  id="${name}_id" name="${name}" 
		 data-options="<#if lable!=''>buttonText:'${lable}:',buttonAlign:'left',</#if>prompt:'${prompt}',cls:'form-input',multiline:true,value:'${value}' <#if tag!=''>,icons:[{iconCls:'icon-must'}]</#if>"/>
	</div>
</#macro>

<#--密码框-->
<#macro passwordInput name lable="" prompt=""  comstyle="width:261px;height:31px;">
	<div>
		<input class="easyui-passwordbox" type="text"  style="${comstyle}"  id="${name}_id" name="${name}" 
		 data-options="<#if lable!="">buttonText:'${lable}:',buttonAlign:'left',</#if>prompt:'${prompt}',cls:'form-input'"/>
	</div>
</#macro>

<#--小按钮-->
<#macro buttonsm name click cls="primary">
	<button type="button" class="btn btn-${cls} btn-sm" onClick="${click}">${name}</button>
</#macro>

<#--查询条件的输入条件框-->
<#macro searchInput lable name sqlsep="EQ" alias="" prompt="">
	${lable}：<input class="easyui-textbox" type="text" id="${name}_search_id" field="<#if alias!="">${alias}.</#if>${name}" sqlsep="${(sqlsep)!'EQ'}" 
		 	data-options="prompt:'${prompt}',cls:'form-input'"/>
</#macro>

<#--隐藏查询输入框-->
<#macro searchHidden name sqlsep value alias="">
	<input  type="hidden" id="${name}_search_id" name="${name}" value="${value}" field="<#if alias!="">${alias}.</#if>${name}" sqlsep="${(sqlsep)!'EQ'}"/>
</#macro>

<#--隐藏普通输入框-->
<#macro hiddenInput name value>
	<input  type="hidden" id="${name}_hidden_id" name="${name}" value="${value}"/>
</#macro>

<#-- 普通按钮 -->
<#macro toolBtn btn opert resId="">
	<#if btn??>
		<#assign urladdr=(btn.url)!''>
		<a href="#" type="oper" operator="${opert}" class="easyui-linkbutton" title="${(btn.text)!''}" 
		url=<#if urladdr!='' && resId!=''>"${base}${urladdr}?resId=${(btn.id)!''}"<#else>"${base}${urladdr}"</#if>
		data-options="iconCls:'icon-${(btn.icons)!''}',plain:true
		,disabled:${(btn.permit)?string('false','true')}">${(btn.text)!''}</a>
	</#if>
</#macro>

<#--刷新-->
<#macro toolRefreshBtn>
	<a href="#" type="oper" operator="refresh" class="easyui-linkbutton" title="刷新" 
	data-options="iconCls:'icon-arrow_refresh',plain:true">刷新</a>
</#macro>

<#--普通按钮-->
<#macro toolGenelBtn id title="" icon="">
	<a href="#" id="${id}"  class="easyui-linkbutton" title="${title}"  data-options="iconCls:'icon-${icon}',plain:true">${title}</a>
</#macro>

<#--分割线-->
<#macro buttonSeparator>
	<span class="datagrid-btn-separator" style="vertical-align: middle;display:inline-block;float:none"></span>
</#macro>

<#--图标选择器-->
<#macro selectIcons name lable="点击选择" cls="primary" value="">
	<div style="width:100%">
		<button type="button" class="btn btn-${cls} btn-sm" id="${name}_button_id" onClick="createIconSelector()">${lable}</button>
		<input  type="hidden" id="${name}_id" name="${name}" value="${value}"/>
		<img id="${name}_img_id" style="width:18px;height:18px;margin-left:10px;" <#if value!="">src="${baseStatic}/easyui/themes/icons/${value?replace('icon-','')}.png"</#if>/>
	</div>
	  <#--控件选择器，图标选择-->
 	<div id="iconsSelectPanelid_${name}" class="easyui-window"  style="width:510px;height:440px;padding:5px;"
 	 data-options="iconCls:'icon-save',modal:true,footer:'#iconsFooter_${name}',title:'图标选择器',closed:true">
 	 </div>
 	<div id="iconsFooter_${name}" style="padding:5px;text-align:center">
    	<a href="javascript:void(0)" class="easyui-linkbutton" 
    	data-options="iconCls:'icon-accept'," onclick="iconSelectConfirm()">确认选择</a>
    	<a href="javascript:void(0)" class="easyui-linkbutton"
    	data-options="iconCls:'icon-no'" onclick="$('#iconsSelectPanelid_${name}').window('close')">关闭</a>
    </div>
 	 <script type="text/javascript">
		function createIconSelector(){
			$('#iconsSelectPanelid_${name}').window('open');
			$('#iconsSelectPanelid_${name}').window('refresh', '${base}/admin/system/widget/Icon');
		}
		function iconSelectConfirm(){
			var iconval=$("input[name='iconName'][checked]").val();
			$("#${name}_id").val("icon-"+iconval);
			$('#${name}_img_id').attr("src","${baseStatic}/easyui/themes/icons/"+iconval+".png");
			$('#iconsSelectPanelid_${name}').window('close');
		}
 	 </script> 
</#macro>

<#--表格创建 带分页-->
<#macro DataGride tableId columns url="" toolbar="true" pagesize="20" single="false">
<table id="${tableId}_list_id" class="easyui-datagrid" 
			    data-options="<#if url!="">url:'${url}',</#if>fitColumns:true,fit:true,striped:true,loadMsg:'正在加载...',
			    pagination:true,rownumbers:true,showFooter:true,striped:true,
			    pageList : [ 10,15,20, 30, 50 ],pageNumber : 1,resizable : true,pageSize : ${pagesize}<#if single=='true'>,singleSelect:'true'</#if>
			    <#if toolbar=="true">,toolbar:'#${tableId}_list_toolbar_id'</#if>
			    ">
			    <thead>
					<tr>
						<#if single!='true'>
						<th field="ck" checkbox="true">全选</th>
						</#if>
						<#list columns as p>
        					<th data-options="field:'${p.field}',width:'${(p.width)!'50'}',halign:'${(p.halign)!'center'}',align:'${(p.align)!'center'}'<#if p.sortable=='true'>,sortable:'false'</#if><#if (p.formatter)??>,formatter:${p.formatter}</#if>"
							 >${p.text}</th>
        				</#list>
					</tr>
			    </thead>
			</table>
</#macro>

<#--表格创建不 带分页-->
<#macro DataGrideNoPage tableId columns url="" toolbar="true" single="false">
<table id="${tableId}_list_id" class="easyui-datagrid" 
			    data-options="<#if url!="">url:'${url}',</#if>fitColumns:true,fit:true,striped:true,loadMsg:'正在加载...',
			    rownumbers:true,showFooter:true,striped:true<#if single=='true'>,singleSelect:'true'</#if>
			    <#if toolbar=="true">,toolbar:'#${tableId}_list_toolbar_id'</#if>">
			    <thead>
					<tr>
						<#if single!='true'>
						<th field="ck" checkbox="true"></th>
						</#if>
						<#list columns as p>
							<th data-options="field:'${p.field}',width:'${(p.width)!'50'}',halign:'${(p.halign)!'center'}',align:'${(p.align)!'center'}',sortable:'${(p.sortable)!'false'}'<#if (p.formatter)??>,formatter:${p.formatter}</#if>"
							 >${p.text}</th>
        				</#list>
					</tr>
			    </thead>
			</table>
</#macro>

<#--表格创建 带分页-->
<#macro DataGrideRecycle tableId columns url="">
<table  id="${tableId}_recycle_id" class="easyui-datagrid" 
    data-options="url:'${url}',toolbar:'#${tableId}_list_recycle_toolbar_id',fitColumns:true,fit:true,striped:true,loadMsg:'正在加载...',pagination:true,rownumbers:true,showFooter:true,striped:true">
    <thead>
		<tr>
			<th field="ck" checkbox="true"></th>
			<#list columns as p>
				<th data-options="field:'${p.field}',width:'${(p.width)!'50'}',halign:'${(p.halign)!'center'}',align:'${(p.align)!'center'}',sortable:'${(p.sortable)!'false'}'<#if (p.formatter)??>,formatter:${p.formatter}</#if>"
							 >${p.text}</th>
        	</#list>
		</tr>
    </thead>
</table>
</#macro>

<#--窗口-->
<#macro window wid icons="" footer="true" showSave="true" showClose="true" title=""  style="width:500px;height:380px;padding:10px;">
	<div id="${wid}_win_edit_id" class="easyui-window"  style="${style}" <#if title!="">title="${(title)!'保存'}"</#if> 
 	data-options="iconCls:'icon-${(icons)!'save'}',modal:true<#if footer=="true">,footer:'#${wid}_win_edit_footer_id'</#if>,closed:true"></div>
 	<div id="${wid}_win_edit_footer_id" style="padding:5px;text-align:center">
 		<#if showSave=="true">
    	<a href="javascript:void(0)" type="save" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
    	</#if>
    	<#if showClose=="true">
    	<a href="javascript:void(0)" type="close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">关闭</a>
    	</#if>
    </div>
</#macro>

<#--窗口-->
<!--
	资源分配的窗口
-->
<#macro myWin id style icon title tooter="">
	<div id="${id}" class="easyui-window"  style="${style}" title="${title}" 
 	data-options="iconCls:'icon-${icon}',modal:true,closed:true<#if tooter!=''>,footer:'#${tooter}'</#if>"></div>
 	<#if tooter!=''>
 		<div id="${tooter}" style="padding:5px;text-align:center">
	 		<a href="javascript:void(0)" type="save" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
	    	<a href="javascript:void(0)" type="close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">关闭</a>
	    </div>
 	</#if>
</#macro>

<#macro divRecycleBegin id>
	<div id="${id}_list_recycle_toolbar_id">
</#macro>
<#macro divBegin id>
	<div id="${id}_list_toolbar_id">
</#macro>
<#macro divEnd>
	</div>
</#macro>

<#-- 设置页面输入框改变提交 -->
<#macro settingInput lable name value="" change="" dtype="string">
	<div><lable>${lable}:</lable><input type="text" name="${name}" value="${value}" onchange="${change}" dtype="${dtype}"></div>
</#macro>


